package com.xuelongjiang.mqdemo.mq;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.rabbit.support.CorrelationData;

/**
 * @author xuelongjiang
 */
public class RabbitConfirmCallback implements RabbitTemplate.ConfirmCallback {


    private static  final Logger LOGGER = LoggerFactory.getLogger(RabbitConfirmCallback.class);

    @Override
    public void confirm(CorrelationData correlationData, boolean b, String s) {


        if(b){
            LOGGER.info("消息确认成功:{}", s);
        }else{
            LOGGER.info("消息确认失败:{}", s);
            
        }

        LOGGER.info("消息回调:{}", correlationData);

    }
}
